{% extends 'layout.html' %}
{% block content %}
<div class="container-fluid">
    <div class="panel panel-default">
        <div class="panel-heading"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询条件</div>
        <form class="form-inline">
            <div class="panel-body">
                <div class="form-group">
                    <label for="jsyf">　1.结算月份</label>
                    {{select_jsyf}}
                </div>
                <div class="form-group">
                    <label for="xmmc">　&nbsp;2.％项目名称%</label>
                    <input type="text" class="form-control" id="xmmc" name="xmmc" value="{{xmmc}}"
                           placeholder="项目名称模糊查询">
                </div>
                <div class="form-group">
                    <label for="fylb">　&nbsp;3.费用类别</label>
                    {{select_fylb}}
                </div>
                <div class="form-group">
                    <label for="zxlb">　&nbsp;4.专项类别</label>
                    {{select_zxlb}}
                </div>
                <div class="form-group">
                    <label for="gys">　&nbsp;5.%供应商%</label>
                    <input type="text" class="form-control" id="gys" name="gys" value="{{gys}}" placeholder="供应商模糊查询">
                </div>
                <div class="form-group">
                    <span>　</span>
                    <input type="hidden" name="page" value="{{page_1.number}}">
                    <input type="hidden" name="pagesize" value="{{page_1.paginator.per_page}}">
                    <input type="submit" class="btn btn-sm btn-primary" style="float: right;margin-top: -5px"
                           value="查询">
                </div>
            </div>
        </form>
    </div>
    <div class="panel panel-default table-responsive">
        <div class="panel-heading">
            <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
            其他合同列表
            <!-- Multiple Select -->
            <div class="input-group" style="float: right;">
                {{ select }}
                <span aria-hidden="true"> </span>
                <a href="{% url 'export-excel-other' %}?start_recno={{ start_recno }}&end_recno={{ end_recno }}"
                   class="btn btn-sm btn-primary" style="margin-top: -6px">导出 Excel</a>
            </div>
        </div>

        <table class="table text-nowrap table-striped table-bordered table-hover">
            <thead>
            <tr style="background-color: #5B9BD5;color: white">
                {% if fields.序号.0 %}
                <th>序号</th>
                {% endif %}
                {% if fields.发票已送.0 %}
                <th>发票已送</th>
                {% endif %}
                {% if fields.结算月份.0 %}
                <th>结算月份</th>
                {% endif %}
                {% if fields.合同编号.0 %}
                <th>合同编号</th>
                {% endif %}
                {% if fields.项目名称.0 %}
                <th>项目名称</th>
                {% endif %}
                {% if fields.费用类别.0 %}
                <th>费用类别</th>
                {% endif %}
                {% if fields.专项类别.0 %}
                <th>专项类别</th>
                {% endif %}
                {% if fields.结算金额.0 %}
                <th>结算金额</th>
                {% endif %}

                {% if fields.供应商.0 %}
                <th>供应商</th>
                {% endif %}
                {% if fields.bggyjhca.0 %}
                <th>1#2#焦炉</th>
                {% endif %}
                {% if fields.bggyjhcb.0 %}
                <th>3#4#焦炉</th>
                {% endif %}
                {% if fields.bggyjhcc.0 %}
                <th>5#6#焦炉</th>
                {% endif %}
                {% if fields.bggyjhce.0 %}
                <th>9#10#焦炉</th>
                {% endif %}
                {% if fields.bggyjhcf1.0 %}
                <th>1#干熄焦</th>
                {% endif %}
                {% if fields.bggyjhcf2.0 %}
                <th>2#干熄焦</th>
                {% endif %}
                {% if fields.bggyjhcg.0 %}
                <th>3#干熄焦</th>
                {% endif %}
                {% if fields.bggyjhch.0 %}
                <th>5#6#干熄焦</th>
                {% endif %}
                {% if fields.bggyjhcj.0 %}
                <th>新煤精</th>
                {% endif %}
                {% if fields.bggyjhcs.0 %}
                <th>新鼓冷</th>
                {% endif %}
                {% if fields.bggyjhcm.0 %}
                <th>三回收</th>
                {% endif %}
                {% if fields.bggyjhcn.0 %}
                <th>供应作业区</th>
                {% endif %}
                {% if fields.bggyjhfa.0 %}
                <th>供焦一</th>
                {% endif %}
                {% if fields.bggyjhfb.0 %}
                <th>供焦二</th>
                {% endif %}
                {% if fields.bggyjhfc.0 %}
                <th>供焦三</th>
                {% endif %}
                {% if fields.bggyjhfj.0 %}
                <th>燃管作业区</th>
                {% endif %}
                {% if fields.bggyjhfn.0 %}
                <th>炼焦综合作业区</th>
                {% endif %}
                {% if fields.bggyjhfp.0 %}
                <th>脱硫脱硝</th>
                {% endif %}
                {% if fields.bggyjhga.0 %}
                <th>原料检修一</th>
                {% endif %}
                {% if fields.bggyjhgb.0 %}
                <th>原料检修二</th>
                {% endif %}
                {% if fields.bggyjhia.0 %}
                <th>水处理</th>
                {% endif %}
                {% if fields.厂部及其他.0 %}
                <th>厂部及其他</th>
                {% endif %}
                {% if fields.bggyjhba.0 %}
                <th>检验作业区</th>
                {% endif %}
                {% if fields.合同金额.0 %}
                <th>合同金额</th>
                {% endif %}
                {% if fields.考核扣款.0 %}
                <th>考核扣款</th>
                {% endif %}
                {% if fields.奖励金额.0 %}
                <th>奖励金额</th>
                {% endif %}
                {% if fields.能源费.0 %}
                <th>能源费</th>
                {% endif %}
                {% if fields.备注.0 %}
                <th>备注</th>
                {% endif %}
            </tr>
            </thead>
            <tbody>

            {% for row in page_1.object_list %}
            <tr>
                {% if fields.序号.0 %}
                <td>{{ row.序号 }}</td>
                {% endif %}
                {% if fields.发票已送.0 %}
                {% if row.发票已送 %}
                <td style="color: fuchsia;text-align: center">是</td>
                {% else %}
                <td style="text-align: center">否</td>
                {% endif %}{% endif %}
                {% if fields.结算月份.0 %}
                <td>{{ row.结算月份 }}</td>
                {% endif %}
                {% if fields.合同编号.0 %}
                <td>{% if row.合同编号 %}{{ row.合同编号 }}{% endif %}</td>
                {% endif %}
                {% if fields.项目名称.0 %}
                <td>{{ row.项目名称 }}</td>
                {% endif %}
                {% if fields.费用类别.0 %}
                {% if row.费用类别 == '备件修复' %}
                <td style="background-color: greenyellow">
                    {% elif row.费用类别 == '零星单项' %}
                <td style="background-color: fuchsia">
                    {% elif row.费用类别 == '安全生产费' %}
                <td style="background-color: red">
                    {% elif row.费用类别 == '专项资金' %}
                <td style="background-color: #c69500">
                    {% elif row.费用类别 == '运输费' %}
                <td style="background-color: lightpink">
                    {% elif row.费用类别 == '维修工程' %}
                <td style="background-color: darkturquoise">
                    {% elif row.费用类别 == '非生产性维修费' %}
                <td style="background-color: #bfd1ec">
                    {% else %}
                <td>
                    {% endif %}
                    {{ row.费用类别 }}
                </td>
                {% endif %}
                {% if fields.专项类别.0 %}
                <td>{% if row.专项类别 %}{{ row.专项类别 }}{% endif %}</td>
                {% endif %}
                {% if fields.结算金额.0 %}
                <td style="text-align: right">{% if row.结算金额 == 0 or row.结算金额 == None %}
                    -{% else %}
                    {{ row.结算金额 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.供应商.0 %}
                <td>{% if row.供应商 %}{{ row.供应商 }}{% endif %}</td>
                {% endif %}
                {% if fields.bggyjhca.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhca == 0 or row.bggyjhca == None %}-{% else %}
                    {{ row.bggyjhca }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcb.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcb == 0 or row.bggyjhcb == None %}-{% else %}
                    {{ row.bggyjhcb }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcc.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcc == 0 or row.bggyjhcc == None %}-{% else %}
                    {{ row.bggyjhcc }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhce.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhce == 0 or row.bggyjhce == None %}-{% else %}
                    {{ row.bggyjhce }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcf1.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcf1 == 0 or row.bggyjhcf1 == None %}-{% else %}
                    {{ row.bggyjhcf1 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcf2.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcf2 == 0 or row.bggyjhcf2 == None %}-{% else %}
                    {{ row.bggyjhcf2 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcg.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcg == 0 or row.bggyjhcg == None %}-{% else %}
                    {{ row.bggyjhcg }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhch.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhch == 0 or row.bggyjhch == None %}-{% else %}
                    {{ row.bggyjhch }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcj.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcj == 0 or row.bggyjhcj == None %}-{% else %}
                    {{ row.bggyjhcj }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcs.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcs == 0 or row.bggyjhcs == None %}-{% else %}
                    {{ row.bggyjhcs }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcm.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcm == 0 or row.bggyjhcm == None %}-{% else %}
                    {{ row.bggyjhcm }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcn.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhcn == 0 or row.bggyjhcn == None %}-{% else %}
                    {{ row.bggyjhcn }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfa.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfa == 0 or row.bggyjhfa == None %}-{% else %}
                    {{ row.bggyjhfa }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfb.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfb == 0 or row.bggyjhfb == None %}-{% else %}
                    {{ row.bggyjhfb }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfc.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfc == 0 or row.bggyjhfc == None %}-{% else %}
                    {{ row.bggyjhfc }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfj.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfj == 0 or row.bggyjhfj == None %}-{% else %}
                    {{ row.bggyjhfj }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfn.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfn == 0 or row.bggyjhfn == None %}-{% else %}
                    {{ row.bggyjhfn }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfp.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhfp == 0 or row.bggyjhfp == None %}-{% else %}
                    {{ row.bggyjhfp }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhga.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhga == 0 or row.bggyjhga == None %}-{% else %}
                    {{ row.bggyjhga }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhgb.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhgb == 0 or row.bggyjhgb == None %}-{% else %}
                    {{ row.bggyjhgb }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhia.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhia == 0 or row.bggyjhia == None %}-{% else %}
                    {{ row.bggyjhia }}{% endif %}
                </td>
                {% endif %}
                {% if fields.厂部及其他.0 %}
                <td style="text-align: right">
                    {% if row.厂部及其他 == 0 or row.厂部及其他 == None %}-{% else %}
                    {{ row.厂部及其他 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhba.0 %}
                <td style="text-align: right">
                    {% if row.bggyjhba == 0 or row.bggyjhba == None %}-{% else %}
                    {{ row.bggyjhba }}{% endif %}
                </td>
                {% endif %}
                {% if fields.合同金额.0 %}
                <td style="text-align: right">{% if row.合同金额 == 0 or row.合同金额 == None %}-{% else %}
                    {{ row.合同金额 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.考核扣款.0 %}
                <td style="text-align: right">{% if row.考核扣款 == 0 or row.考核扣款 == None %}-{% else %}
                    {{ row.考核扣款 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.奖励金额.0 %}
                <td style="text-align: right">{% if row.奖励金额 == 0 or row.奖励金额 == None %}-{% else %}
                    {{ row.奖励金额 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.能源费.0 %}
                <td style="text-align: right">{% if row.能源费 == 0 or row.能源费 == None %}-{% else %}
                    {{ row.能源费 }}{% endif %}
                </td>
                {% endif %}
                {% if fields.备注.0 %}
                <td>{% if row.备注 %}{{ row.备注 }}{% endif %}</td>
                {% endif %}
            </tr>
            {% endfor %}
            <tr style="background-color: yellow">
                {% if fields.序号.0 %}
                <td></td>
                {% endif %}
                {% if fields.发票已送.0 %}
                <td></td>
                {% endif %}
                {% if fields.结算月份.0 %}
                <td></td>
                {% endif %}
                {% if fields.合同编号.0 %}
                <td></td>
                {% endif %}
                {% if fields.项目名称.0 %}
                <td></td>
                {% endif %}
                {% if fields.费用类别.0 %}
                <td></td>
                {% endif %}
                {% if fields.专项类别.0 %}
                <td style="text-align: center">本页合计<br>总合计</td>
                {% endif %}
                {% if fields.结算金额.0 %}
                <td style="text-align: right">{{ sum_row.结算金额__sum }}<br>{{ sum_all.结算金额__sum }}</td>
                {% endif %}
                {% if fields.供应商.0 %}
                <td style="text-align: right">{{ sum_row.项目名称__count }}<br>{{ sum_all.项目名称__count }}</td>
                {% endif %}
                {% if fields.bggyjhca.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhca__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhca__sum }}{% endif %}<br>{% if sum_all.bggyjhca__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhca__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcb.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcb__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcb__sum }}{% endif %}<br>{% if sum_all.bggyjhcb__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcb__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcc.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcc__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcc__sum }}{% endif %}<br>{% if sum_all.bggyjhcc__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcc__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhce.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhce__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhce__sum }}{% endif %}<br>{% if sum_all.bggyjhce__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhce__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcf1.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcf1__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcf1__sum }}{% endif %}<br>{% if sum_all.bggyjhcf1__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcf1__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcf2.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcf2__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcf2__sum }}{% endif %}<br>{% if sum_all.bggyjhcf2__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcf2__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcg.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcg__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcg__sum }}{% endif %}<br>{% if sum_all.bggyjhcg__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcg__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhch.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhch__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhch__sum }}{% endif %}<br>{% if sum_all.bggyjhch__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhch__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcj.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcj__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcj__sum }}{% endif %}<br>{% if sum_all.bggyjhcj__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcj__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcs.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcs__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcs__sum }}{% endif %}<br>{% if sum_all.bggyjhcs__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcs__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcm.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcm__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcm__sum }}{% endif %}<br>{% if sum_all.bggyjhcm__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcm__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhcn.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhcn__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhcn__sum }}{% endif %}<br>{% if sum_all.bggyjhcn__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhcn__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfa.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfa__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfa__sum }}{% endif %}<br>{% if sum_all.bggyjhfa__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfa__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfb.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfb__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfb__sum }}{% endif %}<br>{% if sum_all.bggyjhfb__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfb__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfc.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfc__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfc__sum }}{% endif %}<br>{% if sum_all.bggyjhfc__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfc__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfj.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfj__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfj__sum }}{% endif %}<br>{% if sum_all.bggyjhfj__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfj__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfn.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfn__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfn__sum }}{% endif %}<br>{% if sum_all.bggyjhfn__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfn__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhfp.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhfp__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhfp__sum }}{% endif %}<br>{% if sum_all.bggyjhfp__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhfp__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhga.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhga__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhga__sum }}{% endif %}<br>{% if sum_all.bggyjhga__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhga__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhgb.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhgb__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhgb__sum }}{% endif %}<br>{% if sum_all.bggyjhgb__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhgb__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhia.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhia__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhia__sum }}{% endif %}<br>{% if sum_all.bggyjhia__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhia__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.厂部及其他.0 %}
                <td style="text-align: right">
                    {% if sum_row.厂部及其他__sum == 0 %}-{% else %}
                    {{ sum_row.厂部及其他__sum }}{% endif %}<br>{% if sum_all.厂部及其他__sum == 0 %}-{% else %}
                    {{ sum_all.厂部及其他__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.bggyjhba.0 %}
                <td style="text-align: right">
                    {% if sum_row.bggyjhba__sum == 0 %}-{% else %}
                    {{ sum_row.bggyjhba__sum }}{% endif %}<br>{% if sum_all.bggyjhba__sum == 0 %}-{% else %}
                    {{ sum_all.bggyjhba__sum }}{% endif %}
                </td>
                {% endif %}
                {% if fields.合同金额.0 %}
                <td style="text-align: right">{{ sum_row.合同金额__sum }}<br>{{ sum_all.合同金额__sum }}</td>
                {% endif %}
                {% if fields.考核扣款.0 %}
                <td style="text-align: right">{{ sum_row.考核扣款__sum }}<br>{{ sum_all.考核扣款__sum }}</td>
                {% endif %}
                {% if fields.奖励金额.0 %}
                <td style="text-align: right">{{ sum_row.奖励金额__sum }}<br>{{ sum_all.奖励金额__sum }}</td>
                {% endif %}
                {% if fields.能源费.0 %}
                <td style="text-align: right">{{ sum_row.能源费__sum }}<br>{{ sum_all.能源费__sum }}</td>
                {% endif %}
                {% if fields.备注.0 %}
                <td></td>
                {% endif %}
            </tr>
            </tbody>
        </table>

<!--        <nav aria-label="Page navigation">-->
<!--            <ul class="pagination">-->
<!--                {{ page_string }}-->
<!--            </ul>-->
<!--        </nav>-->
        <!--    分页    -->
        <nav aria-label="Page navigation">
            <ul class="pagination">
                {% if page_1.has_other_pages %}
                    {% if page_1.has_previous %}
                        <li><a href="?page=1&pagesize={{page_1.paginator.per_page}}&jsyf={{jsyf}}&xmmc={{xmmc}}&fylb={{fylb}}&zxlb={{zxlb}}&gys={{gys}}">首页</a></li>
                        <li><a href="?page={{page_1.previous_page_number}}&pagesize={{page_1.paginator.per_page}}&jsyf={{jsyf}}&xmmc={{xmmc}}&fylb={{fylb}}&zxlb={{zxlb}}&gys={{gys}}">上一页</a></li>
                    {%endif%}
                    <li><span>第&nbsp;{{page_1.number}}&nbsp;/&nbsp;{{ page_1.paginator.num_pages }}&nbsp;页</span></li>
                    {% if page_1.has_next %}
                        <li><a href="?page={{page_1.next_page_number}}&pagesize={{page_1.paginator.per_page}}&jsyf={{jsyf}}&xmmc={{xmmc}}&fylb={{fylb}}&zxlb={{zxlb}}&gys={{gys}}">下一页</a></li>
                        <li><a href="?page={{page_1.paginator.num_pages}}&pagesize={{page_1.paginator.per_page}}&jsyf={{jsyf}}&xmmc={{xmmc}}&fylb={{fylb}}&zxlb={{zxlb}}&gys={{gys}}">尾页</a></li>
                    {% endif %}
                {% else %}
                    <li><span>第&nbsp;1&nbsp;/&nbsp;1&nbsp;页</span></li>
                {% endif %}
                <div class="dropup btn-group"> <!-- dropup 上拉框 -->
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {{page_1.paginator.per_page}} 条 <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="?page={{page_1.number}}&pagesize=10&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">10 条</a></li>
                        <li><a href="?page={{page_1.number}}&pagesize=20&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">20 条</a></li>
                        <li><a href="?page={{page_1.number}}&pagesize=50&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">50 条</a></li>
                        <li><a href="?page={{page_1.number}}&pagesize=100&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">100 条</a></li>
                        <li><a href="?page={{page_1.number}}&pagesize=500&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">500 条</a></li>
                        <li><a href="?page={{page_1.number}}&pagesize=1000&jsyf={{jsyf}}&wllx={{wllx}}&fylb={{fylb}}&gwh={{gwh}}&wldm={{wldm}}&xmh={{xmh}}">1000 条</a></li>
                    </ul>
                </div>

            </ul>
        </nav>
    </div>
</div>
    </div>
</div>


{% endblock %}

{% block js %}
<script type="text/javascript">
    $(function () {
        $('#col_select').multipleSelect({
            onClose: function () {
                $.ajax({
                    url: '/contract/other/fields/?f=' + $('#col_select').multipleSelect('getSelects'),
                    type: 'GET',
                    success: function (res) {
                        if (!res.status)
                            alert(res.errors);

                        location.reload();
                    }
                });
            }
        });
    })

</script>
{% endblock %}